home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / WinTlb / COMMDLG.IDL < prev    next >
Text File  |  1997-06-08  |  26KB  |  624 lines

  1. // commdlg.h -- Common Dialog APIs      
  2.  
  3. // Note: This module is not currently used in the Windows API Type Library
  4.  
  5. typedef DWORD LPOFNHOOKPROC;
  6. // typedef UINT (WINAPI *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  7. #undef BSTR
  8.  
  9. #if 0 
  10. typedef struct OPENFILENAME {
  11.    DWORD        lStructSize;
  12.    HWND         hwndOwner;
  13.    HINSTANCE    hInstance;
  14.    LONG /* LPCTSTR */ lpstrFilter;
  15.    LONG /* LPTSTR */ lpstrCustomFilter;
  16.    DWORD        nMaxCustFilter;
  17.    DWORD        nFilterIndex;
  18.    LONG /* LPTSTR */ lpstrFile;
  19.    DWORD        nMaxFile;
  20.    LONG /* LPTSTR */ lpstrFileTitle;
  21.    DWORD        nMaxFileTitle;
  22.    LONG /* LPCTSTR */ lpstrInitialDir;
  23.    LONG /* LPCTSTR */ lpstrTitle;
  24.    DWORD        dwFlags;
  25.    WORD         nFileOffset;
  26.    WORD         nFileExtension;
  27.    LONG /* LPCTSTR */ lpstrDefExt;
  28.    DWORD /* LPARAM */ lCustData;
  29.    LPOFNHOOKPROC lpfnHook;
  30.    LONG /* LPCTSTR */ lpTemplateName;
  31. } OPENFILENAME, *LPOPENFILENAME;
  32. #else
  33. typedef struct OPENFILENAME {
  34.    DWORD        lStructSize;
  35.    HWND         hwndOwner;
  36.    HINSTANCE    hInstance;
  37.    BSTR            lpstrFilter;
  38.    BSTR            lpstrCustomFilter;
  39.    DWORD        nMaxCustFilter;
  40.    DWORD        nFilterIndex;
  41.    BSTR            lpstrFile;
  42.    DWORD        nMaxFile;
  43.    BSTR            lpstrFileTitle;
  44.    DWORD        nMaxFileTitle;
  45.    BSTR            lpstrInitialDir;
  46.    BSTR            lpstrTitle;
  47.    DWORD        dwFlags;
  48.    WORD         nFileOffset;
  49.    WORD         nFileExtension;
  50.    BSTR            lpstrDefExt;
  51.    DWORD /* LPARAM */ lCustData;
  52.    LPOFNHOOKPROC lpfnHook;
  53.    BSTR            lpTemplateName;
  54. } OPENFILENAME, *LPOPENFILENAME;
  55. #endif
  56. /*
  57. // Structure used for all OpenFileName notifications
  58. typedef struct OFNOTIFY {
  59.     NMHDR           hdr;
  60.     LPOPENFILENAMEA lpOFN;
  61.     LPTSTR          pszFile;        // May be NULL
  62. } OFNOTIFY, *LPOFNOTIFY;
  63. */
  64.  
  65. typedef DWORD LPCCHOOKPROC;
  66. //typedef UINT (WINAPI *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  67.  
  68. typedef struct TCHOOSECOLOR {
  69.    DWORD        lStructSize;
  70.    HWND         hwndOwner;
  71.    HWND         hInstance;
  72.    COLORREF     rgbResult;
  73.    DWORD /* COLORREF* */ lpCustColors;
  74.    DWORD        dwFlags;
  75.    DWORD /* LPARAM */ lCustData;
  76.    LPCCHOOKPROC lpfnHook;
  77.    BSTR         lpTemplateName;
  78. } TCHOOSECOLOR, *LPCHOOSECOLOR;
  79.  
  80. typedef DWORD LPFRHOOKPROC;
  81. //typedef UINT (WINAPI *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  82.  
  83. typedef struct FINDREPLACE {
  84.    DWORD        lStructSize;        // size of this struct 0x20
  85.    HWND         hwndOwner;          // handle to owner's window
  86.    HINSTANCE    hInstance;          // instance handle of.EXE that
  87.                                     //   contains cust. dlg. template
  88.    DWORD        dwFlags;              // one or more of the FR_??
  89.    BSTR         lpstrFindWhat;      // ptr. to search string
  90.    BSTR         lpstrReplaceWith;   // ptr. to replace string
  91.    WORD         wFindWhatLen;       // size of find buffer
  92.    WORD         wReplaceWithLen;    // size of replace buffer
  93.    DWORD /* LPARAM */ lCustData;
  94.    LPFRHOOKPROC lpfnHook;           // ptr. to hook fn. or NULL
  95.    BSTR            lpTemplateName;     // custom template name
  96. } FINDREPLACE, *LPFINDREPLACE;
  97.  
  98. typedef DWORD LPCFHOOKPROC;
  99. //typedef UINT (WINAPI *LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  100.  
  101. typedef struct TCHOOSEFONT {
  102.    DWORD           lStructSize;
  103.    HWND            hwndOwner;          // caller's window handle
  104.    HDC             hDC;                // printer DC/IC or NULL
  105.    DWORD /*LPLOGFONT */ lpLogFont;      // ptr. to a LOGFONT struct
  106.    INT             iPointSize;         // 10 * size in points of selected font
  107.    DWORD           dwFlags;              // enum. type flags
  108.    COLORREF        rgbColors;          // returned text color
  109.    DWORD /* LPARAM */ lCustData;
  110.    LPCFHOOKPROC    lpfnHook;           // ptr. to hook function
  111.    BSTR               lpTemplateName;     // custom template name
  112.    HINSTANCE       hInstance;          // instance handle of.EXE that
  113.                                        //   contains cust. dlg. template
  114.    BSTR            lpszStyle;          // return the style field here
  115.                                        // must be LF_FACESIZE or bigger
  116.    WORD            nFontType;          // same value reported to the EnumFonts
  117.                                        //   call back with the extra FONTTYPE_
  118.                                        //   bits added
  119.    WORD            ___MISSING_ALIGNMENT__;
  120.    INT             nSizeMin;           // minimum pt size allowed &
  121.    INT             nSizeMax;           // max pt size allowed if
  122.                                        //   CF_LIMITSIZE is used
  123. } TCHOOSEFONT, *LPCHOOSEFONT;
  124.  
  125. typedef DWORD LPPRINTHOOKPROC;
  126. typedef DWORD LPSETUPHOOKPROC;
  127. //typedef UINT (WINAPI *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  128. //typedef UINT (WINAPI *LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  129.  
  130. typedef struct TPRINTDLG {
  131.    DWORD            lStructSize;
  132.    HWND             hwndOwner;
  133.    HGLOBAL          hDevMode;
  134.    HGLOBAL          hDevNames;
  135.    HDC              hDC;
  136.    DWORD            dwFlags;
  137.    WORD             nFromPage;
  138.    WORD             nToPage;
  139.    WORD             nMinPage;
  140.    WORD             nMaxPage;
  141.    WORD             nCopies;
  142.    HINSTANCE        hInstance;
  143.    DWORD /* LPARAM */ lCustData;
  144.    LPPRINTHOOKPROC  lpfnPrintHook;
  145.    LPSETUPHOOKPROC  lpfnSetupHook;
  146.    BSTR             lpPrintTemplateName;
  147.    BSTR             lpSetupTemplateName;
  148.    HGLOBAL          hPrintTemplate;
  149.    HGLOBAL          hSetupTemplate;
  150. } TPRINTDLG, *LPPRINTDLG;
  151.  
  152. typedef struct DEVNAMES {
  153.    WORD wDriverOffset;
  154.    WORD wDeviceOffset;
  155.    WORD wOutputOffset;
  156.    WORD wDefault;
  157. } DEVNAMES;
  158.  
  159. typedef DEVNAMES * LPDEVNAMES;
  160.  
  161. typedef DWORD LPPAGEPAINTHOOK;
  162. typedef DWORD LPPAGESETUPHOOK;
  163. //typedef UINT (WINAPI* LPPAGEPAINTHOOK)( HWND, UINT, WPARAM, LPARAM );
  164. //typedef UINT (WINAPI* LPPAGESETUPHOOK)( HWND, UINT, WPARAM, LPARAM );
  165.  
  166. typedef struct TPAGESETUPDLG {
  167.     DWORD           lStructSize;
  168.     HWND            hwndOwner;
  169.     HGLOBAL         hDevMode;
  170.     HGLOBAL         hDevNames;
  171.     DWORD           dwFlags;
  172.     POINT           ptPaperSize;
  173.     RECT            rtMinMargin;
  174.     RECT            rtMargin;
  175.     HINSTANCE       hInstance;
  176.     DWORD /* LPARAM */ lCustData;
  177.     LPPAGESETUPHOOK lpfnPageSetupHook;
  178.     LPPAGEPAINTHOOK lpfnPagePaintHook;
  179.     BSTR            lpPageSetupTemplateName;
  180.     HGLOBAL         hPageSetupTemplate;
  181. } TPAGESETUPDLG, * LPPAGESETUPDLG;
  182.  
  183. [
  184. #ifdef UNICODE
  185. uuid(6467505A-3A82-101B-8181-00AA003743D3),
  186. #else
  187. uuid(6467405A-3A82-101B-8181-00AA003743D3),
  188. #endif
  189. helpstring("Common Dialog"),
  190. dllname("COMDLG32.DLL")
  191. ]
  192. module CommonDlg {
  193.  
  194.     [
  195.     usesgetlasterror,
  196.     #ifdef UNICODE
  197.     entry("GetOpenFileNameW"),
  198.     #else
  199.     entry("GetOpenFileNameA"),
  200.     #endif
  201.     helpstring("Creates an Open common dialog box that lets the user specify the drive, directory, and the name of a file or set of files to open")
  202.     ]
  203.     BOOL WINAPI GetOpenFileName(OPENFILENAME * lpofn);
  204.  
  205.     [
  206.     usesgetlasterror,
  207.     #ifdef UNICODE
  208.     entry("GetSaveFileNameW"),
  209.     #else
  210.     entry("GetSaveFileNameA"),
  211.     #endif
  212.     helpstring("Creates a Save common dialog box that lets the user specify the drive, directory, and name of a file to save"),
  213.     ]
  214.     BOOL WINAPI GetSaveFileName(LPOPENFILENAME lpofn);
  215.  
  216.     [
  217.     usesgetlasterror,
  218.     #ifdef UNICODE
  219.     entry("GetFileTitleW"),
  220.     #else
  221.     entry("GetFileTitleA"),
  222.     #endif
  223.     helpstring("Returns the name of the file identified by the lpszFile parameter"),
  224.     ]
  225.     short WINAPI GetFileTitle(LPCTSTR lpszFile, LPTSTR lpszTitle, WORD cbBuf);
  226.  
  227.     const DWORD OFN_READONLY                 = 0x00000001;
  228.     const DWORD OFN_OVERWRITEPROMPT          = 0x00000002;
  229.     const DWORD OFN_HIDEREADONLY             = 0x00000004;
  230.     const DWORD OFN_NOCHANGEDIR              = 0x00000008;
  231.     const DWORD OFN_SHOWHELP                 = 0x00000010;
  232.     const DWORD OFN_ENABLEHOOK               = 0x00000020;
  233.     const DWORD OFN_ENABLETEMPLATE           = 0x00000040;
  234.     const DWORD OFN_ENABLETEMPLATEHANDLE     = 0x00000080;
  235.     const DWORD OFN_NOVALIDATE               = 0x00000100;
  236.     const DWORD OFN_ALLOWMULTISELECT         = 0x00000200;
  237.     const DWORD OFN_EXTENSIONDIFFERENT       = 0x00000400;
  238.     const DWORD OFN_PATHMUSTEXIST            = 0x00000800;
  239.     const DWORD OFN_FILEMUSTEXIST            = 0x00001000;
  240.     const DWORD OFN_CREATEPROMPT             = 0x00002000;
  241.     const DWORD OFN_SHAREAWARE               = 0x00004000;
  242.     const DWORD OFN_NOREADONLYRETURN         = 0x00008000;
  243.     const DWORD OFN_NOTESTFILECREATE         = 0x00010000;
  244.     const DWORD OFN_NONETWORKBUTTON          = 0x00020000;
  245.     const DWORD OFN_NOLONGNAMES              = 0x00040000;    // force no long names for 4.x modules
  246.     const DWORD OFN_EXPLORER                 = 0x00080000;    // new look commdlg
  247.     const DWORD OFN_NODEREFERENCELINKS       = 0x00100000;
  248.     const DWORD OFN_LONGNAMES                = 0x00200000;    // force long names for 3.x modules
  249.  
  250.     // Return values for the registered message sent to the hook function
  251.     // when a sharing violation occurs.  OFN_SHAREFALLTHROUGH allows the
  252.     // filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  253.     // up no warning (returned when the app has already put up a warning
  254.     // message), and OFN_SHAREWARN puts up the default warning message
  255.     // for sharing violations.
  256.     //
  257.     // Note:  Undefined return values map to OFN_SHAREWARN, but are
  258.     //        reserved for future use.
  259.  
  260.     const WORD OFN_SHAREFALLTHROUGH     = 2;
  261.     const WORD OFN_SHARENOWARN          = 1;
  262.     const WORD OFN_SHAREWARN            = 0;
  263.  
  264.     #define CDN_FIRST   (0U-601U)
  265.     #define CDN_LAST    (0U-699U)
  266.  
  267.     // Notifications when Open or Save dialog status changes
  268.     const DWORD CDN_INITDONE            = (CDN_FIRST - 0x0000);
  269.     const DWORD CDN_SELCHANGE           = (CDN_FIRST - 0x0001);
  270.     const DWORD CDN_FOLDERCHANGE        = (CDN_FIRST - 0x0002);
  271.     const DWORD CDN_SHAREVIOLATION      = (CDN_FIRST - 0x0003);
  272.     const DWORD CDN_HELP                = (CDN_FIRST - 0x0004);
  273.     const DWORD CDN_FILEOK              = (CDN_FIRST - 0x0005);
  274.     const DWORD CDN_TYPECHANGE          = (CDN_FIRST - 0x0006);
  275.  
  276.     #define WM_USER        0x0400
  277.  
  278.     #define CDM_FIRST       (WM_USER + 100)
  279.     #define CDM_LAST        (WM_USER + 200)
  280.  
  281.     // Messages to query information from the Open or Save dialogs
  282.  
  283.     // lParam = pointer to text buffer that gets filled in
  284.     // wParam = max number of characters of the text buffer (including NULL)
  285.     // return = < 0 if error; number of characters needed (including NULL)
  286.     const DWORD CDM_GETSPEC             = (CDM_FIRST + 0x0000);
  287.     /*
  288.     #ifndef UNICODE_ONLY
  289.     #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) \
  290.             (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  291.     #endif //!UNICODE_ONLY
  292.     #ifndef ANSI_ONLY
  293.     #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) \
  294.             (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  295.     #endif //!ANSI_ONLY
  296.     #ifdef UNICODE
  297.     #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecW
  298.     #else
  299.     #define CommDlg_OpenSave_GetSpec  CommDlg_OpenSave_GetSpecA
  300.     #endif // !UNICODE
  301.     */
  302.  
  303.     // lParam = pointer to text buffer that gets filled in
  304.     // wParam = max number of characters of the text buffer (including NULL)
  305.     // return = < 0 if error; number of characters needed (including NULL)
  306.     const DWORD CDM_GETFILEPATH        = (CDM_FIRST + 0x0001);
  307.     /*
  308.     #ifndef UNICODE_ONLY
  309.     #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) \
  310.             (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  311.     #endif //!UNICODE_ONLY
  312.     #ifndef ANSI_ONLY
  313.     #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) \
  314.             (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  315.     #endif //!ANSI_ONLY
  316.     #ifdef UNICODE
  317.     #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathW
  318.     #else
  319.     #define CommDlg_OpenSave_GetFilePath  CommDlg_OpenSave_GetFilePathA
  320.     #endif // !UNICODE
  321.     */
  322.  
  323.     // lParam = pointer to text buffer that gets filled in
  324.     // wParam = max number of characters of the text buffer (including NULL)
  325.     // return = < 0 if error; number of characters needed (including NULL)
  326.     const DWORD CDM_GETFOLDERPATH       = (CDM_FIRST + 0x0002);
  327.     /*
  328.     #ifndef UNICODE_ONLY
  329.     #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) \
  330.             (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  331.     #endif //!UNICODE_ONLY
  332.     #ifndef ANSI_ONLY
  333.     #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) \
  334.             (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  335.     #endif //!ANSI_ONLY
  336.     #ifdef UNICODE
  337.     #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathW
  338.     #else
  339.     #define CommDlg_OpenSave_GetFolderPath  CommDlg_OpenSave_GetFolderPathA
  340.     #endif // !UNICODE
  341.     */
  342.  
  343.     // lParam = pointer to ITEMIDLIST buffer that gets filled in
  344.     // wParam = size of the ITEMIDLIST buffer
  345.     // return = < 0 if error; length of buffer needed
  346.     const DWORD CDM_GETFOLDERIDLIST     = (CDM_FIRST + 0x0003);
  347.     /*
  348.     #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
  349.             (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
  350.     */
  351.  
  352.     // lParam = pointer to a string
  353.     // wParam = ID of control to change
  354.     // return = not used
  355.     const DWORD CDM_SETCONTROLTEXT      = (CDM_FIRST + 0x0004);
  356.     /*
  357.     #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) \
  358.             (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
  359.     */
  360.  
  361.     // lParam = not used
  362.     // wParam = ID of control to change
  363.     // return = not used
  364.     const DWORD CDM_HIDECONTROL         = (CDM_FIRST + 0x0005);
  365.     /*
  366.     #define CommDlg_OpenSave_HideControl(_hdlg, _id) \
  367.             (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
  368.     */
  369.  
  370.     // lParam = pointer to default extension (no dot)
  371.     // wParam = not used
  372.     // return = not used
  373.     const DWORD CDM_SETDEFEXT           = (CDM_FIRST + 0x0006);
  374.     /*
  375.     #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) \
  376.             (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
  377.     */
  378.  
  379.  
  380.     [
  381.     usesgetlasterror,
  382.     #ifdef UNICODE
  383.     entry("ChooseColorW"),
  384.     #else
  385.     entry("ChooseColorA"),
  386.     #endif
  387.     helpstring("Creates a Color common dialog box that enables the user to select a color"),
  388.     ]
  389.     BOOL WINAPI ChooseColor(LPCHOOSECOLOR lpcc);
  390.  
  391.     const DWORD CC_RGBINIT               = 0x00000001;
  392.     const DWORD CC_FULLOPEN              = 0x00000002;
  393.     const DWORD CC_PREVENTFULLOPEN       = 0x00000004;
  394.     const DWORD CC_SHOWHELP              = 0x00000008;
  395.     const DWORD CC_ENABLEHOOK            = 0x00000010;
  396.     const DWORD CC_ENABLETEMPLATE        = 0x00000020;
  397.     const DWORD CC_ENABLETEMPLATEHANDLE  = 0x00000040;
  398.     const DWORD CC_SOLIDCOLOR            = 0x00000080;
  399.     const DWORD CC_ANYCOLOR              = 0x00000100;
  400.  
  401.     const DWORD FR_DOWN                         = 0x00000001;
  402.     const DWORD FR_WHOLEWORD                    = 0x00000002;
  403.     const DWORD FR_MATCHCASE                    = 0x00000004;
  404.     const DWORD FR_FINDNEXT                     = 0x00000008;
  405.     const DWORD FR_REPLACE                      = 0x00000010;
  406.     const DWORD FR_REPLACEALL                   = 0x00000020;
  407.     const DWORD FR_DIALOGTERM                   = 0x00000040;
  408.     const DWORD FR_SHOWHELP                     = 0x00000080;
  409.     const DWORD FR_ENABLEHOOK                   = 0x00000100;
  410.     const DWORD FR_ENABLETEMPLATE               = 0x00000200;
  411.     const DWORD FR_NOUPDOWN                     = 0x00000400;
  412.     const DWORD FR_NOMATCHCASE                  = 0x00000800;
  413.     const DWORD FR_NOWHOLEWORD                  = 0x00001000;
  414.     const DWORD FR_ENABLETEMPLATEHANDLE         = 0x00002000;
  415.     const DWORD FR_HIDEUPDOWN                   = 0x00004000;
  416.     const DWORD FR_HIDEMATCHCASE                = 0x00008000;
  417.     const DWORD FR_HIDEWHOLEWORD                = 0x00010000;
  418.  
  419.     [
  420.     usesgetlasterror,
  421.     #ifdef UNICODE
  422.     entry("FindTextW"),
  423.     #else
  424.     entry("FindTextA"),
  425.     #endif
  426.     helpstring("Creates a system-defined modeless dialog box that lets the user specify a string to search for and options to use when searching for text in a document"),
  427.     ]
  428.     HWND WINAPI FindText(LPFINDREPLACE lpfr);
  429.  
  430.     [
  431.     usesgetlasterror,
  432.     #ifdef UNICODE
  433.     entry("ReplaceTextW"),
  434.     #else
  435.     entry("ReplaceTextA"),
  436.     #endif
  437.     helpstring("Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations"),
  438.     ]
  439.     HWND WINAPI ReplaceText(LPFINDREPLACE lpfr);
  440.  
  441.     [
  442.     usesgetlasterror,
  443.     #ifdef UNICODE
  444.     entry("ChooseFontW"),
  445.     #else
  446.     entry("ChooseFontA"),
  447.     #endif
  448.     helpstring("Creates a Font common dialog box that enables the user to choose attributes for a logical font"),
  449.     ]
  450.     BOOL WINAPI ChooseFont(LPCHOOSEFONT lpcf);
  451.  
  452.     const DWORD CF_SCREENFONTS             = 0x00000001;
  453.     const DWORD CF_PRINTERFONTS            = 0x00000002;
  454.     const DWORD CF_BOTH                    = 0x00000003; // (CF_SCREENFONTS | CF_PRINTERFONTS)
  455.     const DWORD CF_SHOWHELP                = 0x00000004;
  456.     const DWORD CF_ENABLEHOOK              = 0x00000008;
  457.     const DWORD CF_ENABLETEMPLATE          = 0x00000010;
  458.     const DWORD CF_ENABLETEMPLATEHANDLE    = 0x00000020;
  459.     const DWORD CF_INITTOLOGFONTSTRUCT     = 0x00000040;
  460.     const DWORD CF_USESTYLE                = 0x00000080;
  461.     const DWORD CF_EFFECTS                 = 0x00000100;
  462.     const DWORD CF_APPLY                   = 0x00000200;
  463.     const DWORD CF_ANSIONLY                = 0x00000400;
  464.     const DWORD CF_SCRIPTSONLY             = 0x00000400; // CF_ANSIONLY
  465.     const DWORD CF_NOVECTORFONTS           = 0x00000800;
  466.     const DWORD CF_NOOEMFONTS              = 0x00000800; // CF_NOVECTORFONTS
  467.     const DWORD CF_NOSIMULATIONS           = 0x00001000;
  468.     const DWORD CF_LIMITSIZE               = 0x00002000;
  469.     const DWORD CF_FIXEDPITCHONLY          = 0x00004000;
  470.     const DWORD CF_WYSIWYG                 = 0x00008000; // must also have CF_SCREENFONTS & CF_PRINTERFONTS
  471.     const DWORD CF_FORCEFONTEXIST          = 0x00010000;
  472.     const DWORD CF_SCALABLEONLY            = 0x00020000;
  473.     const DWORD CF_TTONLY                  = 0x00040000;
  474.     const DWORD CF_NOFACESEL               = 0x00080000;
  475.     const DWORD CF_NOSTYLESEL              = 0x00100000;
  476.     const DWORD CF_NOSIZESEL               = 0x00200000;
  477.     const DWORD CF_SELECTSCRIPT            = 0x00400000;
  478.     const DWORD CF_NOSCRIPTSEL             = 0x00800000;
  479.     const DWORD CF_NOVERTFONTS             = 0x01000000;
  480.  
  481.     // these are extra nFontType bits that are added to what is returned to the
  482.     // EnumFonts callback routine
  483.  
  484.     const WORD SIMULATED_FONTTYPE    = 0x8000;
  485.     const WORD PRINTER_FONTTYPE      = 0x4000;
  486.     const WORD SCREEN_FONTTYPE       = 0x2000;
  487.     const WORD BOLD_FONTTYPE         = 0x0100;
  488.     const WORD ITALIC_FONTTYPE       = 0x0200;
  489.     const WORD REGULAR_FONTTYPE      = 0x0400;
  490.  
  491.     const DWORD WM_CHOOSEFONT_GETLOGFONT      = (WM_USER + 1);   
  492.     const DWORD WM_CHOOSEFONT_SETLOGFONT      = (WM_USER + 101); 
  493.     const DWORD WM_CHOOSEFONT_SETFLAGS        = (WM_USER + 102); 
  494.  
  495.     // strings used to obtain unique window message for communication
  496.     // between dialog and caller
  497.  
  498.     /*
  499.     #define LBSELCHSTRINGA  "commdlg_LBSelChangedNotify"
  500.     #define SHAREVISTRINGA  "commdlg_ShareViolation"
  501.     #define FILEOKSTRINGA   "commdlg_FileNameOK"
  502.     #define COLOROKSTRINGA  "commdlg_ColorOK"
  503.     #define SETRGBSTRINGA   "commdlg_SetRGBColor"
  504.     #define HELPMSGSTRINGA  "commdlg_help"
  505.     #define FINDMSGSTRINGA  "commdlg_FindReplace"
  506.  
  507.     #define LBSELCHSTRINGW  L"commdlg_LBSelChangedNotify"
  508.     #define SHAREVISTRINGW  L"commdlg_ShareViolation"
  509.     #define FILEOKSTRINGW   L"commdlg_FileNameOK"
  510.     #define COLOROKSTRINGW  L"commdlg_ColorOK"
  511.     #define SETRGBSTRINGW   L"commdlg_SetRGBColor"
  512.     #define HELPMSGSTRINGW  L"commdlg_help"
  513.     #define FINDMSGSTRINGW  L"commdlg_FindReplace"
  514.  
  515.     #ifdef UNICODE
  516.     #define LBSELCHSTRING  LBSELCHSTRINGW
  517.     #define SHAREVISTRING  SHAREVISTRINGW
  518.     #define FILEOKSTRING   FILEOKSTRINGW
  519.     #define COLOROKSTRING  COLOROKSTRINGW
  520.     #define SETRGBSTRING   SETRGBSTRINGW
  521.     #define HELPMSGSTRING  HELPMSGSTRINGW
  522.     #define FINDMSGSTRING  FINDMSGSTRINGW
  523.     #else
  524.     #define LBSELCHSTRING  LBSELCHSTRINGA
  525.     #define SHAREVISTRING  SHAREVISTRINGA
  526.     #define FILEOKSTRING   FILEOKSTRINGA
  527.     #define COLOROKSTRING  COLOROKSTRINGA
  528.     #define SETRGBSTRING   SETRGBSTRINGA
  529.     #define HELPMSGSTRING  HELPMSGSTRINGA
  530.     #define FINDMSGSTRING  FINDMSGSTRINGA
  531.     #endif
  532.     */
  533.  
  534.     // HIWORD values for lParam of commdlg_LBSelChangeNotify message
  535.     const WORD CD_LBSELNOITEMS  = -1;
  536.     const WORD CD_LBSELCHANGE   = 0;
  537.     const WORD CD_LBSELSUB      = 1;
  538.     const WORD CD_LBSELADD      = 2;
  539.  
  540.     [
  541.     usesgetlasterror,
  542.     #ifdef UNICODE
  543.     entry("PrintDlgW"),
  544.     #else
  545.     entry("PrintDlgA"),
  546.     #endif
  547.     helpstring("Displays a Print dialog box or a Print Setup dialog box"),
  548.     ]
  549.     BOOL WINAPI PrintDlg(LPPRINTDLG lppd);
  550.  
  551.     const DWORD PD_ALLPAGES                  = 0x00000000;
  552.     const DWORD PD_SELECTION                 = 0x00000001;
  553.     const DWORD PD_PAGENUMS                  = 0x00000002;
  554.     const DWORD PD_NOSELECTION               = 0x00000004;
  555.     const DWORD PD_NOPAGENUMS                = 0x00000008;
  556.     const DWORD PD_COLLATE                   = 0x00000010;
  557.     const DWORD PD_PRINTTOFILE               = 0x00000020;
  558.     const DWORD PD_PRINTSETUP                = 0x00000040;
  559.     const DWORD PD_NOWARNING                 = 0x00000080;
  560.     const DWORD PD_RETURNDC                  = 0x00000100;
  561.     const DWORD PD_RETURNIC                  = 0x00000200;
  562.     const DWORD PD_RETURNDEFAULT             = 0x00000400;
  563.     const DWORD PD_SHOWHELP                  = 0x00000800;
  564.     const DWORD PD_ENABLEPRINTHOOK           = 0x00001000;
  565.     const DWORD PD_ENABLESETUPHOOK           = 0x00002000;
  566.     const DWORD PD_ENABLEPRINTTEMPLATE       = 0x00004000;
  567.     const DWORD PD_ENABLESETUPTEMPLATE       = 0x00008000;
  568.     const DWORD PD_ENABLEPRINTTEMPLATEHANDLE = 0x00010000;
  569.     const DWORD PD_ENABLESETUPTEMPLATEHANDLE = 0x00020000;
  570.     const DWORD PD_USEDEVMODECOPIES          = 0x00040000;
  571.     const DWORD PD_USEDEVMODECOPIESANDCOLLATE = 0x00040000;
  572.     const DWORD PD_DISABLEPRINTTOFILE        = 0x00080000;
  573.     const DWORD PD_HIDEPRINTTOFILE           = 0x00100000;
  574.     const DWORD PD_NONETWORKBUTTON           = 0x00200000;
  575.  
  576.     const WORD DN_DEFAULTPRN      = 0x0001;
  577.  
  578.     [
  579.     usesgetlasterror,
  580.     entry("CommDlgExtendedError"),
  581.     helpstring("Returns a common dialog box error code from the most recent common dialog function"),
  582.     ]
  583.     DWORD WINAPI CommDlgExtendedError(VOID);
  584.  
  585.     const DWORD WM_PSD_PAGESETUPDLG     = (WM_USER  );
  586.     const DWORD WM_PSD_FULLPAGERECT     = (WM_USER+1);
  587.     const DWORD WM_PSD_MINMARGINRECT    = (WM_USER+2);
  588.     const DWORD WM_PSD_MARGINRECT       = (WM_USER+3);
  589.     const DWORD WM_PSD_GREEKTEXTRECT    = (WM_USER+4);
  590.     const DWORD WM_PSD_ENVSTAMPRECT     = (WM_USER+5);
  591.     const DWORD WM_PSD_YAFULLPAGERECT   = (WM_USER+6);
  592.  
  593.     [
  594.     usesgetlasterror,
  595.     #ifdef UNICODE
  596.     entry("PageSetupDlgW"),
  597.     #else
  598.     entry("PageSetupDlgA"),
  599.     #endif
  600.     helpstring("Creates a Page Setup dialog box that enables the user to specify the attributes of a printed page"),
  601.     ]
  602.     BOOL WINAPI PageSetupDlg(LPPAGESETUPDLG lppsd);
  603.  
  604.     const DWORD PSD_DEFAULTMINMARGINS             = 0x00000000; // default (printer's)
  605.     const DWORD PSD_INWININIINTLMEASURE           = 0x00000000; // 1st of 4 possible
  606.  
  607.     const DWORD PSD_MINMARGINS                    = 0x00000001; // use caller's
  608.     const DWORD PSD_MARGINS                       = 0x00000002; // use caller's
  609.     const DWORD PSD_INTHOUSANDTHSOFINCHES         = 0x00000004; // 2nd of 4 possible
  610.     const DWORD PSD_INHUNDREDTHSOFMILLIMETERS     = 0x00000008; // 3rd of 4 possible
  611.     const DWORD PSD_DISABLEMARGINS                = 0x00000010;
  612.     const DWORD PSD_DISABLEPRINTER                = 0x00000020;
  613.     const DWORD PSD_NOWARNING                     = 0x00000080; // must be same as PD_*
  614.     const DWORD PSD_DISABLEORIENTATION            = 0x00000100;
  615.     const DWORD PSD_RETURNDEFAULT                 = 0x00000400; // must be same as PD_*
  616.     const DWORD PSD_DISABLEPAPER                  = 0x00000200;
  617.     const DWORD PSD_SHOWHELP                      = 0x00000800; // must be same as PD_*
  618.     const DWORD PSD_ENABLEPAGESETUPHOOK           = 0x00002000; // must be same as PD_*
  619.     const DWORD PSD_ENABLEPAGESETUPTEMPLATE       = 0x00008000; // must be same as PD_*
  620.     const DWORD PSD_ENABLEPAGESETUPTEMPLATEHANDLE = 0x00020000; // must be same as PD_*
  621.     const DWORD PSD_ENABLEPAGEPAINTHOOK           = 0x00040000;
  622.     const DWORD PSD_DISABLEPAGEPAINTING           = 0x00080000;
  623. }
  624.